package com.dy.nygl.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dy.nygl.mapper.RegionMapper;
import com.dy.nygl.pojo.Region;
import com.dy.nygl.service.RegionService;

@Service("regionService")
public class RegionServiceImpl implements RegionService{

	@Resource(name="regionDAO")
	private RegionMapper regionDAO;
	
	public List<Region> getRegion() {
		List<Region> list = regionDAO.getRegion();
		if(list.size()>0) {
			return list;
		}
		return null;
	}

	public Region getRegionById(int id) {
		Region region =  regionDAO.getRegionById(id);
		if(region != null) {
			return region;
		}
		return null;
	}
	
}
